package day06_exception_collection.com.itheima.d4_collection_travesal;

import java.util.ArrayList;
import java.util.Iterator;

public class Demo1_Collection {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("赵敏");
        list.add("小昭");
        list.add("小華");
        System.out.println("list = " + list);

        Iterator<String> it = list.iterator();
//        System.out.println("it.next() = " + it.next());
//        System.out.println("it.next() = " + it.next());
//        System.out.println("it.next() = " + it.next());
//        System.out.println("it.next() = " + it.next());

        while (it.hasNext()){
            String ele = it.next();
            System.out.println("ele = " + ele);
        }

    }
}
